﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using TenpointSystem.Forms.Base;
using TenpointSystem.Service;

namespace TenpointSystem.Forms
{
    public partial class LoginForm : BaseSystemForm
    {
        public LoginForm() : base()
        {
            InitializeComponent();
        }

        private void LoginForm_Load(object sender, EventArgs e)
        {
            resetForm();
        }

        private void btnLogin_Click(object sender, EventArgs e)
        {
            LoginFormService service = new LoginFormService();
            bool hasUser = service.isVaildUser( txtUserId.Text.Trim(), txtPassword.Text.Trim() );
            if (false == hasUser)
            {
                resetForm();
                MessageBox.Show( "没有该用户信息。" );
                return;
            }


        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void resetForm()
        {
            txtUserId.Text = string.Empty;
            txtPassword.Text = string.Empty;
        }
    }
}
